扩展欧几里得算法:在计算两个整数 (a) 和 (b) 的最大公约数 (\gcd(a,b)) 的同时,求出整数 (x, y),使得满足贝祖等式:
[
ax + by = \gcd(a,b)
]
它常用于求模逆元、解线性丢番图方程等。(除“求最大公约数”外,“扩展”之处在于还返回系数 (x,y)。)
/ɪkˈstɛndɪd juːˈklɪdiən ˈælɡəˌrɪðəm/
The extended Euclidean algorithm finds the gcd and the coefficients (x) and (y).
扩展欧几里得算法能求最大公约数,并给出系数 (x) 和 (y)。
In RSA, we use the extended Euclidean algorithm to compute the modular inverse needed for the private key.
在 RSA 中,我们用扩展欧几里得算法计算生成私钥所需的模逆元。
“Euclidean”源自古希腊数学家欧几里得(Euclid),其《几何原本》奠定了古典数学传统;“algorithm”一词与中世纪学者花剌子密(al-Khwārizmī)的名字相关,后来在欧洲语言中演变为“算法”。“extended(扩展的)”强调:不仅执行欧几里得算法的辗转相除来求 (\gcd),还“扩展”到回代过程,得到满足贝祖等式的系数。